package com.lagou.edu;

public class HttpProtocolUtil {

    public static String getSucceeText(String text){
        String res = "HTTP/1.1 200 OK \n" +
                      "Content-Type: text/html;charset=utf-8 \n" +
                       "Content-Length:" + text.length() +"\n" +
                        "\r\n" +text;
        return res;
    }

    public static String getFailText(){
        String response = "<h1>404 not found</h1>" ;
        String res = "HTTP/1.1 404 NOT FOUND \n" +
                "Content-Type: text/html;charset=utf-8 \n" +
                "Content-Length:" + response.length() +"\n" +
                "\r\n" +
                response;
        return res;
    }
}
